<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button id="clickMe">Click Me</button>
    <script>
      var button = document.getElementById("clickMe");
      button.onclick = function () {
        console.log("1.Button");
      };
      document.body.onclick = function () {
        console.log("2.body");
      };
      document.onclick = function () {
        console.log("3.document");
      };
      window.onclick = function () {
        console.log("4.window");
      };
    </script>
  </body>
</html>
